<script lang="ts">
  import svelteLogo from "./assets/svelte.svg";
  import viteLogo from "/vite.svg";
  import Counter from "./lib/Counter.svelte";
  import Button from "./lib/Button.svelte";
</script>

<main class="flex flex-col items-center p-8 min-h-screen">
  <div class="flex gap-8 mb-4">
    <a href="https://vite.dev" target="_blank" rel="noreferrer">
      <img
        src={viteLogo}
        class="h-24 p-6 transition-filter hover:drop-shadow-xl"
        alt="Vite Logo"
      />
    </a>
    <a href="https://svelte.dev" target="_blank" rel="noreferrer">
      <img
        src={svelteLogo}
        class="h-24 p-6 transition-filter hover:drop-shadow-orange"
        alt="Svelte Logo"
      />
    </a>
  </div>
  <h1 class="text-4xl font-bold mb-6">Vite + Svelte + UnoCSS</h1>

  <div class="mb-8">
    <Counter />
  </div>

  <div class="mb-8">
    <Button text="UnoCSS按钮" onClick={() => alert("UnoCSS工作正常！")} />
  </div>

  <p class="mb-4 text-center">
    Check out <a
      href="https://github.com/sveltejs/kit#readme"
      target="_blank"
      rel="noreferrer"
      class="text-blue-500 hover:underline">SvelteKit</a
    >, the official Svelte app framework powered by Vite!
  </p>

  <p class="text-gray-500 text-sm">
    Click on the Vite and Svelte logos to learn more
  </p>
</main>

<style>
  .logo {
    height: 6em;
    padding: 1.5em;
    will-change: filter;
    transition: filter 300ms;
  }
  .logo:hover {
    filter: drop-shadow(0 0 2em #646cffaa);
  }
  .logo.svelte:hover {
    filter: drop-shadow(0 0 2em #ff3e00aa);
  }
  .read-the-docs {
    color: #888;
  }
</style>
